<template>
  <div>
    <keep-alive>
      <!-- 需要缓存的视图组件 -->
      <router-view v-if="$route.meta.keepAlive"> </router-view>
    </keep-alive>
    <!-- 不需要缓存的视图组件 -->
    <router-view v-if="!$route.meta.keepAlive"> </router-view>
  </div>
</template>

<script>
import { mapActions } from 'vuex'
export default {
  name: 'ChatRouter',
  created() {
    this.initChatList()
  },
  methods: {
    ...mapActions({
      initChatList: 'chatList/initChatList'
    })
  }
}
</script>

<style>

</style>
